﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using ZZQFrameWork;

public class MagicAttrItem : MonoBehaviour,IPool
{
    private Text attrInfoText;
    private AttrData data;

    public AttrData Data
    {
        get
        {
            return data;
        }
        set
        {
            data = value;
            UpdateShow();
        }
    }

    void Awake()
    {
        attrInfoText = transform.GetComponentByPath<Text>("AttrInfo");
    }

    void UpdateShow()
    {
        if (Data == null)
        {
            attrInfoText.text = null;
        }
        else
        {
            attrInfoText.text = data.attrName + ":" + data.attrValue;
        }
    }

    public void Spawn()
    {
    }

    public void UnSpawn()
    {
    }
}